package com.first.util;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.stereotype.Repository;

import java.util.ArrayList;
import java.util.List;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class Echarts {
    private double value;
    private String name;


    public List<Echarts> setEcharts(List<List> lists){
        ArrayList<Echarts> echartss = new ArrayList<>();
        for (List list : lists) {
            Echarts echarts = new Echarts();
            echarts.setName(list.get(0).toString());
            echarts.setValue((Double) list.get(1));
            echartss.add(echarts);
        }
        return echartss;
    }

}
